﻿using System.Data.Entity;
using MaxStoreShop.Domain.Directories;
using MaxStoreShop.Domain.Shop;

namespace MaxStoreShop.Dal
{
    public class ShopContext : DbContext
    {
        const string ConntectionString = "Name=ShopContext";

        public ShopContext()
            : this(ConntectionString)
        {
//            Database.SetInitializer<ShopContext>(null);
            Database.SetInitializer(new DropCreateDatabaseIfModelChanges<ShopContext>());
        }

        public ShopContext(string connectionString)
            : base(connectionString)
        {
//            Database.SetInitializer<ShopContext>(null);
            Database.SetInitializer(new DropCreateDatabaseIfModelChanges<ShopContext>());
        }

        public DbSet<StoreUser> Users { get; set; }
        public DbSet<MeasureType> MeasureTypes { get; set; }
        public DbSet<ProductCategory> ProductCategories { get; set; }
        public DbSet<Character> Characters { get; set; } 
        public DbSet<Debt> Debts { get; set; }
        public DbSet<DebtorRule> DebtorRules { get; set; }
        public DbSet<StorageLocation> StorageLocations { get; set; }
        public DbSet<Supplier> Suppliers { get; set; }
    }
}
